package io.zhile.research.intellij.ier.common

import io.zhile.research.intellij.ier.common.EvalRecord.reset
import io.zhile.research.intellij.ier.common.Resetter
import io.zhile.research.intellij.ier.common.EvalRecord
import io.zhile.research.intellij.ier.common.LicenseFileRecord
import io.zhile.research.intellij.ier.common.NormalFileRecord
import com.intellij.ide.util.PropertiesComponent
import com.intellij.ide.util.PropertiesComponentImpl
import io.zhile.research.intellij.ier.common.PropertyRecord
import io.zhile.research.intellij.ier.common.PreferenceRecord
import io.zhile.research.intellij.ier.helper.ReflectionHelper
import com.intellij.ide.plugins.IdeaPluginDescriptor
import com.intellij.ide.plugins.PluginManager
import io.zhile.research.intellij.ier.helper.NotificationHelper
import com.intellij.openapi.util.SystemInfo
import com.intellij.ide.Prefs
import java.util.prefs.BackingStoreException
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.util.io.FileUtil
import java.io.*
import java.lang.Exception
import kotlin.Throws
import kotlin.jvm.JvmOverloads

class NormalFileRecord(private val file: File) : EvalRecord {
    private val type = "FILE"
    @Throws(Exception::class)
    override fun reset() {
        if (!FileUtil.delete(file)) {
            throw Exception("Remove " + type + " failed: " + file.absolutePath)
        }
    }

    override fun toString(): String {
        return type + ": " + file.name
    }
}